1. Field of the Invention
The present invention relates to any device containing an array of switches. More particularly, this invention relates to a method and apparatus for scanning a switch array, such as a computer keyboard, to determine the closed or open position of each switch, or in the case of a keyboard, which key is being pressed, using few output pins and without requiring multiple clock signals.
2. The Background Art
In computer systems, adding machines, calculators, and other devices containing switches, it is necessary to efficiently determine the position of a switch, or in, the case of a keyboard, which key is being pressed by a user, in order to properly determine what the next action is with respect to that switch position or keypress.
Because a keyboard is a common form of switch array familiar to those of ordinary skill in the art, a keyboard will be used as the preferred example of how this invention is implemented. However, as is readily understood by those skilled individuals, the present invention pertains to switch arrays in general, and may be implemented in a variety of applications containing internal and external switches.
Keyboard designs use one of two methods of determining which key is pressed. One method in use for smaller keyboards is to use one sensing pin per key. According to this method, a fixed voltage is supplied to one terminal of each key switch, and the other terminal of each key switch is connected to an I/O pin of the integrated circuit device containing the keyboard decoder circuitry. When the key is pressed to close the switch, the fixed voltage appears at the I/O pin associated with the key.
Although this method is accurate, it suffers because a separate I/O pin is required for each key on the keyboard. Thus, a standard 101-key computer keyboard would require 101 interface pins. Clearly this method becomes unmanageable and inappropriate for keyboards containing large numbers of keys. It would therefore be advantageous to provide a method for reading a keyboard using fewer pins than the number of keys on the keyboard.
A second method in common use is to provide a matrix of rows and columns of key lines. Key switches are disposed between the row and column lines at intersections thereof. According to this method, the integrated circuit containing the keyboard decoder need only contain a single I/O pin for each row and each column in the matrix. Thus, a fifteen-key keyboard may be scanned using only 8 I/O pins, e.g., five for rows and three for columns, or by any other similar combination of rows and columns.
Prior art keyboards using this second method drive each of one set of lines one at a time and sense the other set of lines for keypress indications. In an example where the row lines are driven and the column lines sensed, the identity of the key being pressed is determined by which column line senses the drive signal, and which of the drive signals is being sensed. This method thus requires both positional and temporal decoding.
A multiphase clock signal is typically used in keyboards which operate according to this second method. The identity of the pressed key may be determined by which driven signal is sensed by which sense line.
Though the method described above is useful for its intended purposes, it suffers from the need to have multiphase clock signals with one phase per driven line. It would therefore be advantageous to provide a method for decoding keyboard keypresses without the need for running a multiphase clock.